﻿using System;

namespace Util.QueryParser.Token
{
    class BooleanNot : IToken
    {
        private readonly IToken t;

        public BooleanNot(IToken t)
        {
            if (t == null)
            {
                throw new ArgumentException("Parameter t must not be null");
            }
            this.t = t;
        }

        public bool Evaluate(string value)
        {
            return !t.Evaluate(value);
        }
    }
}
